from fastapi import APIRouter, UploadFile


from app.schemas.demo import DemoItem

router  = APIRouter()

@router.get("/test")
async def demo():
    return {"message": "Hello FastAPI"}

@router.get("/path/{name}")
async def path(name: str):
    return {"message": f"Hello {name}"}

@router.get("/query")
async def query(skip: int = 0, limit: int = 100):
    return {"message": f"Skip: {skip}, Limit: {limit}"}

@router.post("/sending")
async def sending(item: DemoItem):
    return {"name": item.name, "description": item.description}

@router.post("/upload")
async def upload(file: UploadFile):
    return {"file_size": file.size, "file_name": file.filename}

